Skip to content

dash(s8-p2p.4): reduced-form node.cpp reception bodies [stacks on #656] - #657

Merged
frstrtr merged 2 commits into
masterfrom
dash/s8-p2p-node-cpp-bodies
Jul 10, 2026
Merged

dash(s8-p2p.4): reduced-form node.cpp reception bodies [stacks on #656]#657
frstrtr merged 2 commits into
masterfrom
dash/s8-p2p-node-cpp-bodies

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Scope (integrator-confirmed 2026-07-09)

Reduced dash-native reception bodies for the two link-deferred node.hpp decls, so the Legacy/Actual dispatch layer (#656) actually reaches the tracker.

Slice B — 53e4acf3

  • processing_shares(): phase-1 parallel X11 share_init_verify on m_verify_pool (X11 CPU off the io_context), then hop to io_context.
  • add_verified_shares(): non-blocking try_to_lock(m_tracker_mutex); on contention defer to m_pending_adds (MAX_PENDING_ADDS cap); else skip-null / skip-dup / m_tracker.add.
  • handle_get_share(): non-blocking shared try-lock; empty reply on contention (peer retries elsewhere); m_chain->get_chain walk with stops.
  • DEFERRED per scope: run_think/think, download, best-share, PreparedList topo-sort, fork-index, persist/relay. Not a 1:1 ltc port.

Object-OK enabler — 2f4ce61c (belongs to #656):
#656 handlers referenced obj->m_tx_info.m_new_transaction_hashes (DashShare exposes it directly) and emplace_back(Transaction&) into vector with no matching ctor. Neither is exercised by the 12-handler KAT target, so the dash OBJECT library did not build at a1444b4 despite the green KAT job. Fixed here as a prerequisite. Suggest cherry-picking 2f4ce61c onto #656 before its tap so master never has a broken-object-library window between #656 and this PR.

Verify

  • cmake --build build --target dashnode.cpp.o, protocol_{actual,legacy}.cpp.o all compile; Built target dash (Linux x86_64, clean tree).
  • Both commits GPG-signed (50AB1379285EFE76, Good signature).

Gates

No self-merge — for integrator verify (oracle + full CI) then operator tap.

frstrtr added 2 commits July 9, 2026 23:36
The Legacy/Actual shares handlers reference obj->m_tx_info.m_new_transaction_hashes,
but DashShare exposes m_new_transaction_hashes directly (no m_tx_info wrapper), and
they emplace_back(Transaction&) into a vector<MutableTransaction> with no matching
constructor. Neither is exercised by the 12-handler KAT target, so the dash OBJECT
library did not build at a1444b4 even though the KAT job was green.

- protocol_{actual,legacy}.cpp: m_tx_info.m_new_transaction_hashes -> m_new_transaction_hashes
- coin/transaction.hpp: add symmetric explicit MutableTransaction(const Transaction&)

Object-OK enabler for #656; prerequisite for the s8-p2p.4 reception bodies.
Author the two link-deferred declarations from node.hpp — processing_shares()
and handle_get_share() — plus the add_verified_shares() helper, in their
reduced dash-native form (integrator-confirmed scope, 2026-07-09):

- processing_shares(): phase-1 parallel X11 share_init_verify on m_verify_pool
  (X11 CPU work stays off the io_context), then hop to io_context and
  add_verified_shares().
- add_verified_shares(): non-blocking try_to_lock(m_tracker_mutex); on
  contention defer the batch to m_pending_adds (MAX_PENDING_ADDS cap); else
  skip-null / skip-dup / m_tracker.add under the held lock.
- handle_get_share(): non-blocking shared try_to_lock; empty reply on
  contention (peer retries elsewhere); walk m_chain->get_chain with stops.

DEFERRED to later slices per scope: run_think/think, download, best-share
selection, PreparedList topo-sort, fork-index, persist/relay. Not a 1:1 port
of ltc/node.cpp — dash node is header-only and lacks those symbols.

Object-OK: dash OBJECT library builds (node.cpp.o compiles) on top of the
s8-p2p.2 fixup. Link-gated on #656 merge. Conforms vs frstrtr/p2pool-dash
16->36; dashd-RPC fallback unchanged.
@frstrtr
frstrtr merged commit fa4eef4 into master Jul 10, 2026
26 checks passed
frstrtr added a commit that referenced this pull request Jul 10, 2026
node.cpp reception bodies landed (#656/#657), so dash::Node
(NodeBridge<NodeImpl,Legacy,Actual>) is fully linkable. Link the dash
OBJECT lib into c2pool-dash and replace the NOTE-only report_peering stub
with a real bind: --run now constructs dash::Config + dash::Node and calls
core::Server::listen(port), opening an actual sharechain P2P socket
(default 8999/testnet 18999, --listen [HOST:]PORT override; --connect
suppresses inbound). PREFIX kept as a per-coin isolation primitive from
the frstrtr/p2pool-dash oracle constants.

Inbound reception (version handshake + #646 min-proto gate) is live via
node.cpp. Active outbound dialing of addnode/connect seeds rides the
download/outbound slice (dash::NodeImpl has no start_outbound_connections
yet); seeds are registered in the addr store. dashd-RPC submitblock
fallback untouched.

Verified: c2pool-dash --run --testnet --listen 29777 -> ss shows
LISTEN 0.0.0.0:29777 held by c2pool-dash; Factory started for port 29777.

Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant